home *** CD-ROM | disk | FTP | other *** search
/ Aminet 5 / Aminet 5 - March 1995.iso / Aminet / util / gnu / a2_0b_Emacs_sr.lha / Emacs-19.25 / site-lisp / README < prev    next >
Text File  |  1994-09-10  |  31KB  |  848 lines

  1. README for cc-mode.el 4.85
  2. Barry A. Warsaw <bwarsaw@cnri.reston.va.us>
  3. 1994/09/10 17:18:01
  4.  
  5. Note, you can browse this file either as a flat, multiple page file,
  6. or as an Emacs outline.  As a flat file, just use "C-x ]" to move
  7. forward one page, or "C-x [" to move backward one page.  To read this
  8. as an outline, hit "M-x outline-mode RET".  outline-mode is described
  9. in your Emacs documentation.
  10.  
  11.  
  12. * Introduction
  13.  
  14.     Welcome to cc-mode, version 4.  This is a Emacs Lisp mode for
  15.     editing C, C++, and Objective-C in GNU Emacs.  This mode is
  16.     decendent from c-mode.el (also called "Boring Old C Mode" or bocm
  17.     :-), and c++-mode.el, version 2, which I have been maintaining
  18.     since 1992.  cc-mode represents a significant milestone in the
  19.     mode's life.  It has been fully merged back with Emacs 19's
  20.     c-mode.el. Also a new, more intuitive and flexible mechanism for
  21.     controlling indentation has been developed.  More on this below.
  22.  
  23.     You can now use cc-mode to edit K&R and ANSI C, most ARM C++, and
  24.     Objective-C programs.  See below for limitations.
  25.  
  26.     In lieu of a texinfo manual (which is in the works -- volunteers
  27.     are desperately sought!), this file will describe the following:
  28.  
  29.         * how to get started using cc-mode
  30.     * how to customize the new indentation engine
  31.     * the differences between cc-mode.el and bocm c-mode.el
  32.     * the differences between cc-mode.el and c++-mode.el.
  33.  
  34.     Note that the name of the file is cc-mode.el, and I'll often refer
  35.     to the mode as cc-mode, but there really is no top level cc-mode
  36.     entry point.  I call it cc-mode simply to differentiate it from
  37.     c-mode.el.  All of the variables, commands, and functions in
  38.     cc-mode are prefixed with c-<thing>, and c-mode, c++-mode, and
  39.     objc-mode entry points are provided.  This file is intended to be
  40.     a replacement for c-mode.el and c++-mode.el -- you should be able
  41.     to remove them and dump Emacs with cc-mode.el instead.  See the
  42.     file DUMPING for details on how to do this.
  43.  
  44.     The major version number was incremented to 4 with the addition of
  45.     objc-mode.
  46.  
  47.     This distribution contains release 4.85 of cc-mode.  See below for
  48.     a list of changes since the last release version 4.35.  See the
  49.     MANIFEST for a list of files that should have been included in
  50.     this distribution.
  51.  
  52.     XEmacs 19.11 (formerly Lucid Emacs) now comes with cc-mode.el 4.85
  53.     dumped in the executable.  It has completely replaced c-mode.el
  54.     and c++-mode.el.  Both XEmacs and this distribution now contain a
  55.     new file called cc-compat.el which should ease your transition
  56.     from bocm to cc-mode.  It comes unguaranteed and unsupported.
  57.  
  58.     Note also that I am moving to a new job!  I don't yet know what
  59.     the state of the mailing lists will be, but for a short while, I
  60.     expect mail will get forwarded to my new address, so please
  61.     continue to send bug reports, add/drop messages to the old
  62.     addresses.  I'll make the appropriate announcements to the various
  63.     newsgroups when I know more what's going to happen.  My
  64.     *tentative* new email address is given above.  No guarantees that
  65.     will really be it, as I don't start the job until Sept. 19, 1994.
  66.     Don't try sending mail there at least until after that date.
  67.  
  68.  
  69. * Getting Started
  70.  
  71.     cc-mode.el works well with the 2 main branches of Emacs 19, XEmacs
  72.     (former Lucid Emacs) and the Emacs 19 maintained by the FSF.
  73.     FSF's Emacs 19 users will want to use Emacs version 19.21 or
  74.     better, XEmacs/Lucid users will want 19.6 or better.  cc-mode.el
  75.     works moderately well with Emacs 18, if you use the cc-mode-18.el
  76.     compatibility file.  A word of warning though, Emacs 18 lacks some
  77.     fundamental functionality that makes Emacs 18 support a losing
  78.     battle.  Hence it is no longer supported and it is highly
  79.     recommended that you upgrade to Emacs 19.  If you use cc-mode
  80.     under Emacs 18, you're on your own.  With cc-mode version 5, Emacs
  81.     18 support will be dropped altogether.
  82.  
  83.     The first thing you want to do is put cc-mode.el somewhere on your
  84.     load-path where Emacs can find it.  Do a "C-h v load-path" to see
  85.     all the directories Emacs looks at when loading a file.  If none
  86.     of these directories are appropriate, create a new directory and
  87.     add it to your load-path:
  88.  
  89.         [in the shell]
  90.     % cd
  91.     % mkdir mylisp
  92.     % mv cc-mode.el mylisp
  93.     % cd mylisp
  94.  
  95.     [in your .emacs file add]
  96.     (setq load-path (cons "~/mylisp" load-path))
  97.  
  98.     Next you want to byte-compile cc-mode.el.  The mode uses a lot of
  99.     macros so if you don't byte-compile it, things will be unbearably
  100.     slow.  YOU CAN IGNORE ALL BYTE-COMPILER WARNINGS!  They are the
  101.     result of the multi-Emacs support and none of the warnings have
  102.     any effect on operation. Let me say this again: YOU REALLY CAN
  103.     IGNORE ALL BYTE-COMPILER WARNINGS!
  104.  
  105.     Here's what to do to byte-comple the file [in emacs]:
  106.  
  107.     M-x byte-compile-file RET ~/mylisp/cc-mode.el RET
  108.  
  109.     Most users will probably be running an Emacs that already has bocm
  110.     c-mode.el dumped.  You will not want to use this, or any older
  111.     releases of c++-mode.el if you use cc-mode.el.  If your Emacs is
  112.     dumped with either of these files you first need to make Emacs
  113.     "forget" about those older modes.
  114.  
  115.     If you can do a "C-h v c-mode-map" you probably need to add these
  116.     lines at the top of your .emacs file:
  117.  
  118.         (fmakunbound 'c-mode)
  119.         (makunbound 'c-mode-map)
  120.         (fmakunbound 'c++-mode)
  121.         (makunbound 'c++-mode-map)
  122.     (makunbound 'c-style-alist)
  123.  
  124.     After those lines you will want to add the following autoloads to
  125.     your .emacs file so that cc-mode gets loaded at the right time:
  126.  
  127.         (autoload 'c++-mode  "cc-mode" "C++ Editing Mode" t)
  128.         (autoload 'c-mode    "cc-mode" "C Editing Mode" t)
  129.         (autoload 'objc-mode "cc-mode" "Objective-C Editing Mode" t)
  130.  
  131.     Important note: XEmacs 19.11 already have cc-mode.el dumped in
  132.     their Emacs, so if you are using that Emacs, do *not* add the
  133.     *makunbound or autoload lines above!
  134.  
  135.     Next, you will want to set up Emacs so that it edits C files in
  136.     c-mode, C++ files in c++-mode, and Objective-C files in objc-mode.
  137.     All users (including XEmacs users) should add the following to
  138.     your .emacs file after the autoload lines above.  Note that this
  139.     assumes you'll be editing .h and .c files as C, .hh, .C, and .cc
  140.     files as C++, and .m files as Objective-C. Your mileage may vary:
  141.  
  142.     (setq auto-mode-alist
  143.       (append '(("\\.C$"     . c++-mode)
  144.             ("\\.cc$"    . c++-mode)
  145.             ("\\.hh$"    . c++-mode)
  146.             ("\\.c$"     . c-mode)
  147.             ("\\.h$"     . c-mode)
  148.             ("\\.m$"  . objc-mode)
  149.            ) auto-mode-alist))
  150.  
  151.     You may already have some or all of these settings on your
  152.     auto-mode-alist, but it won't hurt to put them on there again.
  153.  
  154.     That's all you need. After you've done all this, you should quit
  155.     and restart Emacs.  The next time you visit a C, C++, or
  156.     Objective-C file you should be using cc-mode.  You can check this
  157.     easily by hitting "C-c C-v" in the c-mode, c++-mode, or objc-mode
  158.     buffer.  You should see this message in the echo area:
  159.  
  160.         Using cc-mode version 4.85
  161.  
  162.  
  163. * New indentation engine
  164.  
  165.     cc-mode has a new indentation engine, providing a simplified, yet
  166.     flexible and general mechanism for customizing indentation. It
  167.     breaks indentation calculation into two steps. First it tries to
  168.     figure out what kind of language construct its looking at, then it
  169.     applies a user defined offset to the current line based on the
  170.     type of construct it finds.
  171.  
  172.     This section will briefly cover how indentation is calculated in
  173.     cc-mode. Only enough detail will be given so that you will know
  174.     how to customize indentation.  Plenty of examples will be given to
  175.     help you stylize your code, but more detailed examples will be
  176.     left to the texinfo manual (when it is complete) and your own
  177.     exploration.  You can also contact the help address given below.
  178.  
  179. ** Step 1: Syntactic Analysis
  180.  
  181.     In the first step, cc-mode looks at the line you are currently
  182.     indenting and tries to determine the syntactic components of the
  183.     construct on that line.  cc-mode builds a list of these syntactic
  184.     components, where each component on the list contains a "syntactic
  185.     symbol" and a relative buffer position.  Syntactic symbols
  186.     describe elements of C/C++/Objc code such as `statement',
  187.     `substatement', `class-open', `class-close', `knr-argdecl', etc.
  188.     You can do a "C-h v c-offsets-alist" to see the entire list of
  189.     support syntactic symbols along with a description of the
  190.     constructs they represent.
  191.  
  192.     Conceptually, a line of C/C++/Objc code is always indented
  193.     relative to the indentation of some line higher up in the buffer.
  194.     This is represented by the relative buffer positions in the
  195.     syntactic component list.
  196.  
  197.     Here's an example. Suppose we had the following code in a c++-mode
  198.     buffer (the line numbers don't actually appear in the buffer):
  199.  
  200.   Example 1:
  201.  
  202.     1: void swap( int& a, int& b ) 
  203.     2: {
  204.     3:     int tmp = a;
  205.     4:     a = b;
  206.     5:     b = tmp;
  207.     6: }
  208.  
  209.     We can use the command C-c C-s (c-show-syntactic-information) to
  210.     simply report what syntactic analysis is for a line.  If we hit
  211.     C-c C-s on line 4, we'd see in the echo area:
  212.  
  213.         ((statement . 36))
  214.  
  215.     This tells us that the line is a statement and it is indented
  216.     relative to buffer position 36, which happens to be the `i' in
  217.     "int" on line 3.  If you were to move point to line 3 and hit C-c
  218.     C-s, you would see:
  219.  
  220.         ((defun-block-intro . 30))
  221.  
  222.     This indicates that the `int' line is the first statement in a
  223.     block, and is indented relative to buffer position 30, which is
  224.     the brace just after the function header.
  225.  
  226.     Here's another example:
  227.  
  228.   Example 2:
  229.  
  230.     1: int add( int val, int incr, int doit )
  231.     2: {
  232.     3:     if( doit )
  233.     4:         {
  234.     5:             return( val + incr );
  235.     6:         }
  236.     7:     return( val );
  237.     8: }
  238.  
  239.     Hitting C-c C-s on line 4 gives us:
  240.  
  241.         ((substatement-open . 46))
  242.  
  243.     which tells us that this is a brace that `opens' a substatement
  244.     block. By the way, a `substatement' indicates the line after an
  245.     if, else, while, do, switch, and for statements.  See the variable
  246.     c-offsets-alist for a full description of the available syntactic
  247.     symbols.
  248.  
  249.     Syntactic analysis lists can contain more than one element
  250.     (i.e. cons cell), and syntactic symbols need not have relative
  251.     buffer positions.
  252.  
  253. ** Step 2: Indentation Calculation
  254.  
  255.     Indentation for the current line is calculated using the list of
  256.     syntactic components derived in step 1 above.  Each component
  257.     contributes to the final total indentation of the line in two
  258.     ways.
  259.  
  260.     First, the syntactic symbol is looked up in the c-offsets-alist
  261.     variable, which is an association list of syntactic symbols and
  262.     the offsets to apply for those symbols.  This offset is added to
  263.     the running total.
  264.  
  265.     Second, if the component has a relative buffer position, cc-mode
  266.     adds the column number of that position to the running total.  By
  267.     adding up the offsets and columns for every syntactic component on
  268.     the list, the final total indentation for the current line is
  269.     computed.
  270.  
  271.     Lets use our two code examples above to see how this works.  Just
  272.     as a reminder and a convenience the code is presented again here.
  273.  
  274.   Example 1:
  275.  
  276.     1: void swap( int& a, int& b ) 
  277.     2: {
  278.     3:     int tmp = a;
  279.     4:     a = b;
  280.     5:     b = tmp;
  281.     6: }
  282.  
  283.     Lets say point is on line 3 and we hit the TAB key to re-indent
  284.     the line.  Remember that the syntactic component list for that
  285.     line is:
  286.  
  287.         ((defun-block-intro . 30))
  288.  
  289.     So first cc-mode is going to look up `defun-block-intro' in the
  290.     c-offsets-alist variable.  Lets say it find the integer `4'; it
  291.     adds this to the running total (initialized to zero), yielding a
  292.     running total indentation of 4 spaces.
  293.  
  294.     Next cc-mode goes to buffer position 30 and asks for the current
  295.     column.  Since the brace at buffer position 30 is in column zero,
  296.     it adds 0 to the running total, and since there is only one
  297.     syntactic component on the list for this line, the total
  298.     indentation for the line is 4 spaces.
  299.  
  300.   Example 2:
  301.  
  302.     1: int add( int val, int incr, int doit )
  303.     2: {
  304.     3:     if( doit )
  305.     4:         {
  306.     5:             return( val + incr );
  307.     6:         }
  308.     7:     return( val );
  309.     8: }
  310.  
  311.     If we were to hit TAB on line 4 in example 2 above, the same basic
  312.     process is performed, despite the differences in the syntactic
  313.     component list.  Remember that the list for this line is:
  314.  
  315.         ((substatement-open . 46))
  316.  
  317.     Here, cc-mode first looks up the `substatement-open' symbol in
  318.     c-offsets-alist, for which it might find `4'.  At this point the
  319.     running total is 4 (0 + 4 = 4).  cc-mode then goes to buffer
  320.     position 46, which is the `i' in "if" on line 3.  This character
  321.     is in the fourth column on that line so adding this to the running
  322.     total, yields an indentation for the line of 8 spaces.
  323.  
  324.     Simple, huh?
  325.  
  326.     Actually, the mode usually just does The Right Thing without you
  327.     having to think about it in this much detail.  But when
  328.     customizing indentation, its good to have a general idea of the
  329.     indentation model being used.
  330.  
  331.  
  332. * Customizing Indentation
  333.  
  334.     The c-offsets-alist variable is where you customize all your
  335.     indentations.  You simply need to decide what additional offset
  336.     you want to add for every syntactic symbol.  You can use the
  337.     command C-c C-o (c-set-offset) as the way to set offsets, both
  338.     interactively and from your mode hook.  Also, you can set up
  339.     "styles" of indentation just like in standard c-mode.el.  But
  340.     you'll probably find that most of the offsets are right for your
  341.     style.
  342.  
  343.     In fact, the offset values in c-offsets-alist can be an integer, a
  344.     function or variable name, or one of the following symbols: +, -,
  345.     ++, or --, indicating positive or negative multiples of the
  346.     variable c-basic-offset.  Thus if you like the general indentation
  347.     levels, but you use 3 spaces instead of 4 spaces per level, you
  348.     can probably achieve your style by just changing c-basic-offset
  349.     like so (in your .emacs file):
  350.  
  351.         (setq c-basic-offset 3)
  352.  
  353.     The offset value can also be a function, and this can really give
  354.     power users a lot of flexibility in customizing indentation.
  355.  
  356.     As an example of how to customize indentation, lets change the
  357.     style of example 2 above from:
  358.  
  359.     1: int add( int val, int incr, int doit )
  360.     2: {
  361.     3:     if( doit )
  362.     4:         {
  363.     5:             return( val + incr );
  364.     6:         }
  365.     7:     return( val );
  366.     8: }
  367.  
  368.     to:
  369.  
  370.     1: int add( int val, int incr, int doit )
  371.     2: {
  372.     3:     if( doit )
  373.     4:     {
  374.     5:         return( val + incr );
  375.     6:     }
  376.     7:     return( val );
  377.     8: }
  378.  
  379.     Since line 4 is the start of the construct we want to re-indent,
  380.     we first move to that line and hit C-c C-s:
  381.  
  382.         ((substatement-open . 46))
  383.  
  384.     So we know want to change the `substatement-open' indentation.  To
  385.     do this interactively, just hit C-c C-o.  This prompts you for the
  386.     syntactic symbol to change, giving you a reasonable default, in
  387.     this case, substatement-open, which is just the syntactic symbol
  388.     we want to change!
  389.  
  390.     After you hit return cc-mode will then prompt you for the new
  391.     offset value, with the old value as the default.  Hit backspace to
  392.     delete the old value, then hit "0" and then return.  This moves
  393.     the construct one level of indentation to the left.
  394.  
  395.     To check your changes quickly, just hit C-c C-q to reindent the
  396.     entire function.  If this does what you want, you can put the
  397.     following lisp in your c-mode-common-hook (see below for an
  398.     example):
  399.  
  400.         (c-set-offset 'substatement-open 0)
  401.  
  402.     You could also set up a "style" that sets this and all your
  403.     customizations in a convenient manner.  See the variable
  404.     c-style-alist and the command c-set-style for more information, or
  405.     take a look at the sample .emacs file below.
  406.     
  407.  
  408. * Frequently Asked Questions
  409.  
  410.     Q. How do I re-indent the whole file?
  411.     A. Visit the file and hit "C-x h" to mark the whole buffer. Then
  412.        hit "ESC C-\" to re-indent the entire region which you've just
  413.        marked.
  414.  
  415.     Q. How do I re-indent the entire function? ESC C-x doesn't work
  416.     A. ESC C-x is reserved for future Emacs use.  To re-indent the
  417.        entire function hit C-c C-q.
  418.  
  419.     Q. How do I re-indent the current block?
  420.     A. First move to the brace which opens the block with "ESC C-u",
  421.        then re-indent that expression with "ESC C-q".
  422.  
  423.     Q. Why doesn't the RET key indent the line to where the new text
  424.        should go after inserting the newline?
  425.     A. Emacs' convention is that RET just add a new line, and that LFD
  426.        adds a newline and indents.  You can make RET do this too by
  427.        adding this to your c-mode-common-hook (see the sample .emacs
  428.        file below):
  429.  
  430.        (define-key c-mode-map "\C-m" 'newline-and-indent)
  431.  
  432.        This is a very common question. :-) If you want this to be the
  433.        default behavior, don't lobby me, lobby RMS!
  434.  
  435.     Q. I put (c-set-offset 'substatement-open 0) in my .emacs file and
  436.        I get an error saying that c-set-offset's function definition is
  437.        void.
  438.     A. Since cc-mode is autoloaded, it is typically not loaded into
  439.        your Emacs session by the time of the c-set-offset call.
  440.        Instead of putting this in your top-level .emacs file, put the
  441.        call to c-set-offset in your c-mode-common-hook.  See the
  442.        sample .emacs file below for details.
  443.  
  444.  
  445. ;; Sample .emacs file
  446.  
  447. ;; Of course there are lots of other indentation features that I
  448. ;; haven't touched on here.  Until the texinfo is complete, you're
  449. ;; going to have to explore these on your own.  Here's a sample .emacs
  450. ;; file that might help you along the way.  Just hit "C-x C-p", then
  451. ;; "ESC w" to copy this region, then paste it into your .emacs file
  452. ;; with "C-y".  You may want to change some of the actual values.
  453.  
  454. (defconst my-c-style
  455.   '("PERSONAL"
  456.     (c-tab-always-indent           . t)
  457.     (c-comment-only-line-offset    . 4)
  458.     (c-hanging-braces-alist        . ((substatement-open after)
  459.                       (brace-list-open)))
  460.     (c-hanging-colons-alist        . ((member-init-intro before)
  461.                       (inher-intro)
  462.                       (case-label after)
  463.                       (label after)
  464.                       (access-label after)))
  465.     (c-cleanup-list                . (scope-operator
  466.                       empty-defun-braces
  467.                       defun-close-semi))
  468.     (c-offsets-alist               . ((arglist-close     . c-lineup-arglist)
  469.                       (substatement-open . 0
  470.                       (case-label        . 4)
  471.                       (block-open        . 0)
  472.                       (knr-argdecl-intro . -)))
  473.     (c-echo-syntactic-information-p . t)
  474.     )
  475.   "My C Programming Style")
  476.  
  477. ;; Customizations for both c-mode and c++-mode
  478. (defun my-c-mode-common-hook ()
  479.   ;; set up for my perferred indentation style, but  only do it once
  480.   (let ((my-style "PERSONAL"))
  481.     (or (assoc my-style c-style-alist)
  482.     (setq c-style-alist (cons my-c-style c-style-alist)))
  483.     (c-set-style my-style))
  484.   ;; offset customizations not in my-c-style
  485.   (c-set-offset 'member-init-intro '++)
  486.   ;; other customizations
  487.   (setq tab-width 8
  488.     ;; this will make sure spaces are used instead of tabs
  489.     indent-tabs-mode nil)
  490.   ;; we like auto-newline and hungry-delete
  491.   (c-toggle-auto-hungry-state 1)
  492.   ;; keybindings for C, C++, and Objective-C.  We can put these in
  493.   ;; c-mode-map because c++-mode-map and objc-mode-map inherit it
  494.   (define-key c-mode-map "\C-m" 'newline-and-indent)
  495.   )
  496.  
  497. ;; the following only works in Emacs 19
  498. ;; Emacs 18ers can use (setq c-mode-common-hook 'my-c-mode-common-hook)
  499. (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
  500.  
  501.  
  502. * User level differences between cc-mode.el and c-mode.el (as
  503.   distributed with FSF Emacs 19.22).
  504.  
  505.     New indentation engine (described above).
  506.  
  507.     Direct support for C++ and Objective-C editing.
  508.  
  509.     Menubar support (Emacs 19 only).
  510.  
  511.     New variables:
  512.         c-mode-common-hook
  513.         c-strict-semantics-p
  514.         c-echo-semantic-information-p
  515.         c-basic-offset
  516.         c-offsets-alist
  517.         c-comment-only-line-offset
  518.         c-block-comments-indent-p
  519.         c-cleanup-list
  520.         c-hanging-braces-alist
  521.         c-hanging-colons-alist
  522.         c-untame-characters (Emacs 18 users only)
  523.         c-special-indent-hook
  524.         c-delete-function
  525.         c-electric-pound-behavior
  526.         c-backscan-limit (Emacs 18 users only)
  527.  
  528.     Expanded semantics for variables:
  529.         c-tab-always-indent
  530.     c-style-alist
  531.  
  532.     New minor-mode features: auto-newline and hungry-delete-key (do
  533.     "C-h f c-toggle-auto-hungry-state RET" for more info).
  534.  
  535.     New commands:
  536.         c-toggle-auto-state         (C-c C-a)
  537.     c-toggle-hungry-state       (C-c C-d)
  538.     c-toggle-auto-hungry-state  (C-c C-t)
  539.     c-electric-delete           (DEL)
  540.         c-electric-slash            (/)
  541.     c-electric-star             (*)
  542.     c-set-offset                (C-c C-o)
  543.     c-forward-into-nomenclature
  544.     c-backward-into-nomenclature
  545.     c-scope-operator
  546.     c-tame-insert               (Emacs 18 only)
  547.     c-tame-comments             (Emacs 18 only)
  548.     c-indent-defun              (C-c C-q)
  549.     c-show-semantic-information (C-c C-s)
  550.     c-version                   (C-c C-v)
  551.     c-submit-bug-report         (C-c C-b)
  552.  
  553.     Renamed commands:
  554.         electric-c-brace      => c-electric-brace
  555.     electric-c-semi       => c-electric-semi&comma
  556.     electric-c-sharp-sign => c-electric-pound
  557.     mark-c-function       => c-mark-function
  558.         electric-c-terminator => c-electric-colon
  559.     indent-c-exp          => c-indent-exp
  560.     set-c-style           => c-set-style
  561.  
  562.     Obsolete variables:
  563.         c-indent-level
  564.     c-brace-imaginary-offset
  565.     c-brace-offset
  566.     c-argdecl-indent
  567.     c-label-offset
  568.     c-continued-statement-offset
  569.     c-continued-brace-offset
  570.  
  571.  
  572. * User level differences between cc-mode.el and c++-mode.el 2.353
  573.   (a.k.a cplus-md1.el in FSF 19):
  574.  
  575.     New Indentation Engine (described above).
  576.  
  577.     General rename of all variables and defuns from c++-<thing> to
  578.     c-<thing>.  I don't list them all individually here.
  579.  
  580.     Direct support for C and Objective-C editing.
  581.  
  582.     Menubar support (Emacs 19 only).
  583.  
  584.     New variables:
  585.         c-strict-semantics-p
  586.     c-echo-semantic-information-p
  587.     c-basic-offset
  588.     c-offsets-alist
  589.     c-style-alist
  590.  
  591.     New commands:
  592.         c-set-offset
  593.     c-set-style
  594.     c-fill-paragraph
  595.     c-forward-into-nomenclature
  596.     c-backward-into-nomenclature
  597.     c-scope-operator
  598.     c-beginning-of-statement
  599.     c-end-of-statement
  600.     c-up-conditional
  601.     c-backward-conditional
  602.     c-forward-conditional
  603.     c-show-semantic-information
  604.  
  605.     Other renamed commands/variables:
  606.         c++-c-mode                    => c-mode
  607.     c++-C-block-comments-indent-p => c-block-comments-indent-p
  608.         c++-hanging-braces            => c-hanging-braces-alist
  609.     c++-hanging-member-init-colon => c-hanging-colons-alist
  610.         c++-default-macroize-column   => c-backslash-column
  611.     c++-macroize-region           => c-backslash-region
  612.         c++-electric-semi             => c-electric-semi&comma
  613.  
  614.     Obsolete variables/commands:
  615.         c++-always-arglist-indent-p
  616.     c++-block-close-brace-offset
  617.     c++-paren-as-block-close-p
  618.     c++-continued-member-init-offset
  619.     c++-member-init-indent
  620.     c++-friend-offset
  621.     c++-access-specifier-offset
  622.     c++-empty-arglist-indent
  623.     c++-auto-hungry-initial-state
  624.     c++-auto-hungry-toggle
  625.     c++-relative-offset-p
  626.     c++-match-header-strongly
  627.     c++-beginning-of-defun
  628.     c++-end-of-defun
  629.     c++-insert-header
  630.     c++-match-paren
  631.     c++-forward-sexp
  632.     c++-backward-sexp
  633.         c++-comment-region
  634.     c++-uncomment-region
  635.  
  636.  
  637. * For more information
  638.  
  639.     The best thing to do at this point is poke around the source code.
  640.     Eventually there will be an extensive texinfo manual describing
  641.     the mode in greater detail.  Can I say this again?  Volunteers to
  642.     help finish the manual are desperately sought!
  643.  
  644.  
  645. * Requirements
  646.  
  647.     cc-mode.el requires reporter.el for submission of bug reports.
  648.     reporter.el is distributed with the latest FSF and Lucid Emacs
  649.     19's.  See below for Emacs Lisp Archive anonymous ftp'ing
  650.     instructions for those of you who are using older Emacsen.
  651.  
  652.  
  653. * Limitations and Known Bugs
  654.  
  655.     multi-line macros are not handled properly.
  656.  
  657.     re-indenting large regions or expressions can be slow.
  658.  
  659.     Use with Emacs 18 can be slow and annoying. You should seriously
  660.     consider upgrading to Emacs 19.
  661.  
  662.     indentation of some nested switch constructs are known to be
  663.     broken.
  664.  
  665.     there is still some weird behavior when filling C block comments.
  666.     My suggestion is to check out add-on fill packages such as
  667.     filladapt, available at the elisp archive.
  668.  
  669.  
  670. * Electronic Mail
  671.  
  672.     To report bugs, use the C-c C-b (c-submit-bug-report) command.
  673.     This provides vital information I need to reproduce your problem.
  674.     Make sure you include a stripped down code example.
  675.  
  676.     For other help or suggestions, send a message to
  677.     cc-mode-help@anthem.nlm.nih.gov.
  678.  
  679.     To get on the beta testers list, send an add message to
  680.     cc-mode-victims-request@anthem.nlm.nih.gov.  Note that this is a
  681.     fairly technical discussion list so you should be moderately Emacs
  682.     lisp fluent and have anonymous ftp access.
  683.  
  684.     There is also an announce only list where you will get beta
  685.     version update diffs, but will not join in the technical
  686.     discussions.  You should still have anon-ftp, and you shouldn't
  687.     expect beta releases to be as stable as public releases.  Send an
  688.     add message to cc-mode-announce-request@anthem.nlm.nih.gov to be
  689.     added to this list.
  690.  
  691.     Please use these addresses instead of my personal address so I can
  692.     keep track of all the incoming mail!
  693.  
  694.  
  695. * Here's the Emacs Lisp Archive information for reporter.el:
  696.  
  697.      GNU Emacs Lisp Code Directory Apropos -- "reporter"
  698. "~/" refers to archive.cis.ohio-state.edu:/pub/gnu/emacs/elisp-archive/
  699.  
  700. reporter (1.23)          02-Feb-1993
  701.      Barry A. Warsaw, <bwarsaw@cen.com>
  702.      ~/misc/reporter.el.Z
  703.      Customizable bug reporting of lisp programs.
  704.  
  705.  
  706. * User visible changes since 4.35
  707.  
  708. ** c-set-offset and related functions and variables can now accept
  709.    variable symbols.  Also ++ and -- which mean 2* positive and
  710.    negative c-basic-offset respectively.
  711.  
  712. ** new variable, c-recognize-knr-p, which controls whether K&R C
  713.    contructs will be recognized.  Trying to recognize K&R constructs
  714.    is a time hog so if you're programming strictly in ANSI C, set this
  715.    variable to nil (it should already be nil in c++-mode).
  716.  
  717. ** new variable, c-hanging-comment-ender-p for controlling
  718.    c-fill-paragraph's behavior.
  719.  
  720. ** new syntactic symbol: statement-case-open.  This is assigned to
  721.    lines containing an open brace just after a case/default label.
  722.  
  723. ** new variable, c-progress-interval, which controls minibuffer update
  724.    message displays during long re-indention.  This is a new feature
  725.    which prints percentage complete messages at specified intervals.
  726.  
  727. ** Better menu titles in FSF's Emacs.
  728.  
  729. ** Improved selective-display compatibility.
  730.  
  731. ** Bug fixes, bug fixes, bug fixes!
  732.  
  733. ** Some performance enhancements, but nothing radically better.
  734.  
  735.  
  736. * User visible changes since 3.349
  737.  
  738. ** New major-mode: objc-mode for Objective-C editing. Also added,
  739.    objc-mode-hook, objc-mode-abbrev-table, objc-mode-map, and
  740.    objc-mode-syntax-table.
  741.  
  742. ** New syntactic symbols objc-method-intro, objc-method-args, and
  743.    objc-method-call-cont have been added, with appropriate offsets in
  744.    c-offsets-alist.
  745.  
  746. ** Ellemtel style puts substatement-open braces on their own line.
  747.  
  748. ** Better conformance to GNU coding style. New line up function set on
  749.    arglist-close for GNU style: c-lineup-arglist-intro-after-paren.
  750.  
  751. ** bracket lists are treated like paren lists (i.e. they are given the
  752.    appropriate arglist-* syntax).
  753.  
  754. ** some changes to recognition of brace-lists. When an otherwise
  755.    brace-list-entry or brace-list-intro is found to start with an open
  756.    brace, the line is given brace-list-open syntax instead.
  757.  
  758. ** brace-list-intro and brace-list-entry are hangable via
  759.    c-hanging-braces-alist.
  760.  
  761. ** c-set-offset provides a reasonable default in the prompt.
  762.  
  763. ** various name changes to commands and variables for consistency of
  764.    terminology.  The changes are:
  765.  
  766.    Cmd/Var   Old Name                       New Name
  767.    -------   --------                       --------
  768.    [var]     c-strict-semantics-p           c-strict-syntax-p
  769.    [var]     c-echo-semantic-information-p  c-echo-syntactic-information-p
  770.    [var]     c-semantics                    c-syntactic-context
  771.    [cmd]     c-show-syntactic-information   c-show-syntactic-information
  772.  
  773.    some other, non-user-level name changes were effected as well
  774.  
  775. ** Usual gobs of bug fixes.
  776.  
  777.  
  778. * User-visible Changes Since 3.304
  779.  
  780. ** You can now specify `hanginess' of close braces. See
  781.    c-hanging-braces-alist.
  782.  
  783. ** New syntactic symbol `substatement-open' to control indentation of
  784.    braces which open a substatement block (i.e. if, for, ...).  C-c
  785.    C-s used to call these ((block-open . ??) (substatement . ??)), but
  786.    now they are just ((substatement-open . ??)).  WARNING: THIS CHANGE
  787.    MAY AFFECT YOUR CURRENT INDENTATION SETTINGS.
  788.  
  789. ** c-adaptive-block-open lineup function is removed. Obsoleted by
  790.    substatement-open change above.
  791.  
  792. ** New "Default" style returns indentation variables to their default
  793.    values.
  794.  
  795. ** Support for Lucid Emacs 19.10's mode-popup-menu convention.
  796.  
  797. ** c-macro-expand command put on C-c C-e.
  798.  
  799. ** New buffer-local variable c-comment-start-regexp. Useful for using
  800.    cc-mode as a basis for other C-like languages.
  801.  
  802. ** c++-mode handles try/catch blocks.  Assigns them `substatement'
  803.    syntax similar to if/for/while/...
  804.  
  805. ** c-indent-via-language-element renamed to c-indent-line for
  806.    awk-mode, BOCM compatibility.
  807.  
  808. ** Usual gobs of bug fixes.
  809.  
  810.  
  811. * User-visible Changes Since 3.229
  812.  
  813. ** Tons 'o performance enhancements.
  814.  
  815. ** Tons 'o bug fixes.
  816.  
  817. ** Improved support for nested structs in C.
  818.  
  819. ** Emacs 18 support has been split out into a separate file,
  820.    cc-mode-18.el. Emacs 18 support is a losing battle, so after this
  821.    release, I am not going to actively maintain cc-mode for Emacs 18,
  822.    although I will incorporate contributed patches to cc-mode-18.el.
  823.  
  824. ** The last of the dependencies on c-mode.el should be removed.
  825.  
  826. ** New syntactic symbol, defun-block-intro, which controls the
  827.    indentation for the first line in a top-level function or class.
  828.  
  829. ** c-indent-defun moved to C-c C-q
  830.  
  831. ** c-scope-operator moved to C-c :
  832.  
  833. ** New coding style added to c-style-alist: Ellemtel.  This supports
  834.    the C++ coding style defined in "Programming in C++, Rules and
  835.    Recommendations", Erik Nyquist and Mats Henricson, Ellemtel,
  836.    ftp'able from euagate.eua.ericsson.se.
  837.  
  838. ** c-set-style now modifies the global values by default. Buffer local
  839.    versions are made when optional universal argument is given.
  840.  
  841. ** New variable: c-inhibit-startup-warnings-p
  842.  
  843. ** New custom indentation functions, which are not used by default:
  844.    c-lineup-math and c-lineup-runin-statements.  The former lines up
  845.    math statement-cont lines after the equals sign.  The latter lines
  846.    up statement lines when the first statement in a block appears on
  847.    the same line as the block opening brace.
  848.